﻿#region Disclaimer/Info
///////////////////////////////////////////////////////////////////////////////////////////////////
// MetaCollection
// 
// MetaCollection is a system to provide a standard structure, permissions and metadata service
// for content organization.
//
// This project is hosted at Google Code at http://code.google.com/p/metacollection/
//
// This project is licensed under the BSD license.  See the License.txt file for more information.
///////////////////////////////////////////////////////////////////////////////////////////////////
#endregion

using System;

namespace MetaCollection.Framework.Model
{
	/// <summary>
	/// A <see cref="IProviderType"/> contains the configuration and references needed
	/// to load a <see cref="T:MetaCollection.Framework.Provider.IProvider"/>
	/// that will provide services for the Item's resource or the handling of the resource.
	/// 
	/// This ProviderType should load a ResourceProvider or similar IProvider which supports the
	/// ResourceProvider Events.  The Provider is responsible for the persistence and the shape (Model)
	/// of Items.  The configuration information in this record could be used by a ResourceProvider
	/// to determine which Item Properties are required or how the persistence store (IItemRepository,
	/// IResourceRepository, other) are configured.
	/// </summary>
	public interface IProviderType
	{
		/// <summary>
		/// Friendly Name of this specfic Provider Type instance (must be unique within a collection)
		/// </summary>
		string Name { get; set; }
		/// <summary>
		/// A fully qualified assembly name to use when creating an instance
		/// of this provider.
		/// </summary>
		string AssemblyName { get; set; }
		/// <summary>
		/// The specific type name within <see cref="AssemblyName"/> that extends
		/// <see cref="T:MetaCollection.Framework.Provider.ResourceProvider"/>
		/// </summary>
		string TypeName { get; set; }
		/// <summary>
		/// Configuration information that will be passed into the provider
		/// instance when it is created.
		/// </summary>
		string Config { get; set; }
	}
	/// <summary>
	/// A structure representing a ProviderType
	/// </summary>
	[Serializable()]
	public struct ProviderType : IProviderType
	{
		/// <summary>
		/// Friendly Name of this specfic Provider Type instance (must be unique within a collection)
		/// </summary>
		public string Name { get; set; }
		/// <summary>
		/// A fully qualified assembly name to use when creating an instance
		/// of this provider.
		/// </summary>
		public string AssemblyName { get; set; }
		/// <summary>
		/// The specific type name within <see cref="AssemblyName"/> that extends
		/// <see cref="T:MetaCollection.Framework.Provider.ResourceProvider"/>
		/// </summary>
		public string TypeName { get; set; }
		/// <summary>
		/// Configuration information that will be passed into the provider
		/// instance when it is created.
		/// </summary>
		public string Config { get; set; }
	}
}
